﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DefineSysRole.aspx.cs"
    Inherits="UI.ModSystem.DefineSysRole" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>自定义系统菜单角色</title>
    <link rel="stylesheet" type="text/css" href="../Styles/BaseStyle.css" />
    <script type="text/javascript" src="../JS/jsFunction.js"></script>
    <script type="text/javascript">
        function FillText(SysRoleID, Name) {
            this.form1.txtSysRoleID.value = SysRoleID;
            this.form1.txtName.value = Name;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="pagetop" class="pagetop">
        <div class="pagetopleft">
            定义角色</div>
        <div class="pagetopright">
        </div>
    </div>
    <table style="width: 100%">
        <tr align="center" >
            <td style="height: 21px">
                自定义角色
            </td>
            <td style="height: 21px">
                系统内定角色
            </td>
        </tr>
        <tr align="center" valign="top">
            <td>
                <asp:GridView ID="gvDefine" runat="server" AutoGenerateColumns="False" DataKeyNames="SysRoleID"
                    Width="100%" onrowcommand="gvDefine_RowCommand" BackColor="White" 
                    BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                    GridLines="Horizontal">
                    <AlternatingRowStyle BackColor="#F7F7F7" />
                    <Columns>
                        <asp:TemplateField HeaderText="角色编号" SortExpression="SysRoleID">
                            <ItemTemplate>
                                <a style="cursor: hand" onclick="javascript:FillText('<%# Eval("SysRoleID") %>','<%# Eval("Name") %>')">
                                    <%# Eval("SysRoleID")%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Name" HeaderText="角色名称" SortExpression="Name" />
                         <asp:TemplateField HeaderText="操作">
                    <itemtemplate>                    
                    <asp:LinkButton ID="lbtnConfigMenu"   CommandArgument='<%# Eval("SysRoleID") %>'  CommandName="cmdConfigMenu" runat="server">菜单</asp:LinkButton>
                    <asp:LinkButton ID="lbtnConfigRight"   CommandArgument='<%# Eval("SysRoleID") %>'  CommandName="cmdConfigRight" runat="server">权限</asp:LinkButton>
                    </itemtemplate> 
                </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                    <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <SortedAscendingCellStyle BackColor="#F4F4FD" />
                    <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
                    <SortedDescendingCellStyle BackColor="#D8D8F0" />
                    <SortedDescendingHeaderStyle BackColor="#3E3277" />
                </asp:GridView>
                <table style="width: 80%;">
                    <tr>
                        <td style="height: 17px;">
                         角色编号：   <asp:TextBox ID="txtSysRoleID" runat="server" CssClass="InputCss"></asp:TextBox>
                        </td>
                        <td style="height: 17px;">
                           角色名称: <asp:TextBox ID="txtName" runat="server" CssClass="InputCss"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <asp:Button ID="btnAdd" runat="server" Text="添加" CssClass="ButtonCss" OnClick="btnAdd_Click" />&nbsp;
                <asp:Button ID="btnModify" runat="server" CssClass="InputCss" Text="修改" OnClick="btnModify_Click" />
                &nbsp;<asp:Button ID="btnDel" runat="server" CssClass="InputCss" Text="删除" OnClick="btnDel_Click"
                    OnClientClick="要删除该角色以及该角色的菜单？" />
                &nbsp;
                <asp:Button ID="btnSetMenu" runat="server" CssClass="InputCss" Text="设定菜单" OnClick="btnSetMenu_Click" />
            </td>
            <td>
                <asp:GridView ID="gvDefault" runat="server" AutoGenerateColumns="False" DataKeyNames="SysRoleID"
                    Width="100%" onrowcommand="gvDefault_RowCommand" BackColor="White" 
                    BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                    GridLines="Horizontal">
                    <AlternatingRowStyle BackColor="#F7F7F7" />
                    <Columns>
                        <asp:BoundField DataField="SysRoleID" HeaderText="角色编号" ReadOnly="True" SortExpression="SysRoleID" />
                        <asp:BoundField DataField="Name" HeaderText="角色名称" SortExpression="Name" />
                         <asp:TemplateField HeaderText="操作">
                    <itemtemplate>                    
                    <asp:LinkButton ID="lbtnConfigMenu2"   CommandArgument='<%# Eval("SysRoleID") %>'  CommandName="cmdConfigMenu2" runat="server">菜单</asp:LinkButton>
                    <asp:LinkButton ID="lbtnConfigRight2"   CommandArgument='<%# Eval("SysRoleID") %>'  CommandName="cmdConfigRight2" runat="server">权限</asp:LinkButton>
                    </itemtemplate> 
                </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                    <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                    <SortedAscendingCellStyle BackColor="#F4F4FD" />
                    <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
                    <SortedDescendingCellStyle BackColor="#D8D8F0" />
                    <SortedDescendingHeaderStyle BackColor="#3E3277" />
                </asp:GridView>
                <br />
                <br />
            </td>
        </tr>
    </table>
    <br />
    备注： 角色编号不可修改，如果想修改角色编号，请删除后，重新增加角色。
    </form>
</body>
</html>
